﻿Imports System.IO
Imports System.Collections.ObjectModel

Public MustInherit Class Scanner(Of TTokenType)

    Private m_lexicon As Lexicon(Of TTokenType)
    Private m_stateManager As ScannerStateManager
    Private m_engine As DFAScannerEngine
    Private m_sourceReader As TextReader

    Private m_tokenTypes As IList(Of TTokenType)

    Protected Sub New()

    End Sub

    Private Sub Initialize()
        m_lexicon = New Lexicon(Of TTokenType)
        m_stateManager = New ScannerStateManager

        OnDefineLexicon(m_lexicon, m_stateManager)

        'if there's no state defined, define the entire lexicon as one state 0
    End Sub

    Protected Overridable Sub OnDefineLexicon(ByVal lexicon As Lexicon(Of TTokenType), ByVal stateManager As IScannerStateManager)

    End Sub

    Public Property ScannerState As Integer
        Get
            Throw New NotImplementedException
        End Get
        Set(ByVal value As Integer)

        End Set
    End Property

    Public Function Peek() As IToken
        Throw New NotImplementedException
    End Function

    Public Function Peek2() As IToken
        Throw New NotImplementedException
    End Function

    Public Function PeekInState(ByVal state As Integer) As IToken
        Throw New NotImplementedException
    End Function

    Public Function Read() As IToken
        Throw New NotImplementedException
    End Function

    Public ReadOnly Property Previous As IToken
        Get
            Throw New NotImplementedException
        End Get
    End Property

    Public ReadOnly Property Location As Location
        Get
            Throw New NotImplementedException
        End Get
    End Property

    Public Function SeekBackwards(ByVal token As IToken)
        Throw New NotImplementedException
    End Function

    Public ReadOnly Property CurrentTokenIndex As Integer
        Get
            Throw New NotImplementedException
        End Get
    End Property

    Public ReadOnly Property HistoryTokens As ReadOnlyCollection(Of IToken)
        Get
            Throw New NotImplementedException
        End Get
    End Property

    Public ReadOnly Property IsOnFirstToken() As Boolean
        Get
            'Return _Position = -1
            Throw New NotImplementedException
        End Get
    End Property

    Private m_TabSpaces As Integer = 4

    ''' <summary>
    ''' Gets/sets a number of the columns a tab character represents.
    ''' </summary>
    Public Property TabSpaces() As Integer
        Get
            Return m_TabSpaces
        End Get

        Set(ByVal value As Integer)
            If Value < 1 Then
                Throw New ArgumentException("Tabs cannot represent less than one space.")
            End If

            m_TabSpaces = Value
        End Set
    End Property
End Class
